export const actionTypes = {
    TYPE_REQUEST: 'TYPE_REQUEST',
    TYPE_SUCCESS: 'TYPE_SUCCESS',
    TYPE_ERROR: 'TYPE_ERROR',

    LIST_REQUEST: 'LIST_REQUEST',
    LIST_SUCCESS: 'LIST_SUCCESS',
    LIST_ERROR: 'LIST_ERROR',

    DETAIL_REQUEST: 'DETAIL_REQUEST',
    DETAIL_SUCCESS: 'DETAIL_SUCCESS',
    DETAIL_ERROR: 'DETAIL_ERROR',

    LOAD_DATA: 'LOAD_DATA',
    LOAD_DATA_SUCCESS: 'LOAD_DATA_SUCCESS'
};

//redux-saga
const actions = {
    fetchNewsType: () => ({
        type: actionTypes.TYPE_REQUEST
    }),
    fetchNewsList: (id, page) => ({
        type: actionTypes.LIST_REQUEST,
        id,
        page
    }),
    fetchNewsDetail: (id) => ({
        type: actionTypes.DETAIL_REQUEST,
        id,
    }),
    loadUserData: () => ({ type: actionTypes.LOAD_DATA })
};

export default actions;
